const app = getApp()
Page({
  data: {
    //durl: "http://112.45.158.81:19001/flv/34020000001110001003340200000013200000011?EndTime=1747633117&Key=60B6A28E&Hash=51205BC44D&uid=ww9abe823fccad8ce8--c1234"
    // gbserver: "203.56.1.218:8092"
    // mdserver: "112.45.158.81:19001"
    // mdserver3: "112.45.158.81:19001"
    // re: "ok"
    // vurl: "rtmp://112.45.158.81:19001/live/34020000001110001003340200000013200000011?EndTime=1747633117&Key=60B6A28E&Hash=51205BC44D&uid=ww9abe823fccad8ce8--c1234"
    // wsurl: "ws://112.45.158.81:19001/flv/34020000001110001003340200000013200000011?EndTime=1747633117&Key=60B6A28E&Hash=51205BC44D&uid=ww9abe823fccad8ce8--c1234"
    urls: {
      SD: 'rtmp://58.200.131.2:1935/livetv/hunantv',
      HD: 'rtmp://58.200.131.2:1935/livetv/hunantv'
    },
    isFullScreen: false
  },
  onLoad(options) {
    console.log(options)
    this.getCameraInfo(options)
  },
  getCameraInfo(ids) {
    app.axios('item', {
      op: "getplayaddr",
      rgbnum: ids.rgbnum,//录像机
      gbnum: ids.gbnum,//通道
      qstream: 0,//0高清 1普清 H回放
    }).then(res => {
      if (res.code) {
        this.setData({
          'urls.SD': res.durl
        })
      }
    })
    app.axios('item', {
      op: "getplayaddr",
      rgbnum: ids.rgbnum,//录像机
      gbnum: ids.gbnum,//通道
      qstream: 1,//0高清 1普清 H回放
    }).then(res => {
      if (res.code) {
        this.setData({
          'urls.HD': res.durl
        })
      }
    })
  },
  handleFullscreenChange(e) {
    console.log(e)
    const isFullScreen = e.detail.isFullScreen;
    this.setData({ isFullScreen: isFullScreen })
  }
})